package com.xbq.exceleditor.db.dao

import androidx.room.*
import com.xbq.exceleditor.db.entity.ExcelBean

/**
 * Author: liaohaiping
 * Time: 2020-04-24
 * Description:
 */
@Dao
interface ExcelBeanDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insert(vararg users: ExcelBean)

    @Update
    suspend fun update(vararg users: ExcelBean)

    @Delete
    suspend fun delete(vararg users: ExcelBean)

    @Query("SELECT * FROM t_excelinfo where title like :title ORDER BY createTime DESC")
    suspend fun findbyTitle(title: String): List<ExcelBean>

    @Query("select * from t_excelinfo where id=:id")
    suspend fun findById(id: Int): ExcelBean?

    @Query("select * from t_excelinfo order by id desc LIMIT :pageSize OFFSET :offset")
    suspend fun findAll(pageSize:Int,offset:Int): List<ExcelBean>


}